
#include "pthread3.hpp"

// 这里是测试函数

int main()
{
    Pthread::Thread _thread([]()
                            {
        while(true)
        { 
            std::cout<<"hello world!"<<std::endl;
            sleep(1);
            break;
        } });

    _thread.Start();
    std::cout << _thread.Name() << std::endl;
    sleep(5);

    std::cout << "Stop thread is   " << _thread.Stop() << _thread.Name() << std::endl;
    sleep(1);

    std::cout << "Join thread is   " << _thread.Join() << _thread.Name() << std::endl; // 如果线程被取消了 那么pthread_join()的返回值就是0

    return 0;
}